﻿using System;
using System.Globalization;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Be.Timvw.Framework.Domain.Ranges
{
    /// <summary>
    /// Specifications for the string representation of a range.
    /// </summary>
    [TestClass]
    public class WhenGettingStringRepresentationFromRange
    {
        /// <summary>
        /// The range should be representated as "begin" - "end".
        /// </summary>
        [TestMethod]
        public void ShouldReturnAsProvidedFormat()
        {
            Range<DateTime> dateTimeRange = RangeFactory.GetRangeForDaysFromFirstJanuary2000(10);
            string expected = string.Format(CultureInfo.InvariantCulture, "{0} - {1}", dateTimeRange.Begin, dateTimeRange.End);
            Assert.AreEqual(expected, dateTimeRange.ToString());
        }
    }
}